package edu.dayu.prototype;

import java.util.ArrayList;
import java.util.List;

public class Report implements Cloneable{
    private List<String> parts;

    public Report(){
        this.parts = new ArrayList<>();
    }

    public Report(List<String> parts){
        this.parts = parts;
    }

    // 耗时的数据加载操作
    public void loadData(){
        parts.clear();
        parts.add("a");
        parts.add("b");
        parts.add("c");
        parts.add("d");
        parts.add("e");
    }

    public List<String> getContents(){
        return parts;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        List<String> cloneList = new ArrayList<>(parts);
        return new Report(cloneList);
    }
}
